<?php
/**
 * 商品热度分析
 *
 *
 ***/

defined('InShopNC') or exit('Access Invalid!');
class feverControl extends SystemControl{
    const EXPORT_SIZE = 5000;
    public function __construct() {
        parent::__construct ();
        //Language::read('goods');
    }
    
    public function fever_listOp(){
        if($_GET['start']){
            $_POST['start']=$_GET['start'];
        }else{
            $_POST['start']=strtotime($_POST['start'].' 00:00:00');
        }
        if($_GET['end']){
            $_POST['end']=$_GET['end'];
        }else{
            $_POST['end']=strtotime($_POST['end'].' 23:59:59');
        }
        $_POST['key']=$_REQUEST['key'];

        $con='1 ';
        $con .=" and fever_actiontime > ".$_POST['start']." and fever_actiontime < ".$_POST['end'];

        if(!empty($_POST['key']) && $_POST['key']!=null){
            $con =$con." and fever_goodsname like '%".$_POST['key']."%'";
        }

        $model_fever=Model('fever');
        $result=$model_fever->getFeverList($con);
        
        Tpl::output('key',$_POST['key']);
        Tpl::output('start',$_POST['start']);
        Tpl::output('end',$_POST['end']);
        Tpl::output('fever_list',$result);
        Tpl::showpage('fever.fever_list');
    }
    
    public function fever_detailOp(){
        $condition['fever_goodsid']=$_GET['goods_id'];
        $model_fever=Model('fever');
        $fever_list=$model_fever->getFeverDtlist($condition);
        Tpl::output('fever_dtlist',$fever_list);
        Tpl::output('start',$_REQUEST['start']);
        Tpl::output('end',$_REQUEST['end']);
        Tpl::output('key',$_REQUEST['key']);
        Tpl::showpage('fever.fever_dtlist');
        
    }
}